<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="聚焦Java性能优化 打造亿级流量秒杀系统,">










<meta name="description" content="本文为慕课网 《聚焦Java性能优化 打造亿级流量秒杀系统》视频教程的学习笔记实战视频地址： https://coding.imooc.com/class/chapter/338.html前期免费视频地址： http://www.imooc.com/learn/1079代码地址：https://gitee.com/aiolos123/secondkill 本文为第三章jmeter性能压测的内容">
<meta name="keywords" content="聚焦Java性能优化 打造亿级流量秒杀系统">
<meta property="og:type" content="article">
<meta property="og:title" content="【九】聚焦Java性能优化 打造亿级流量秒杀系统——性能压测">
<meta property="og:url" content="https://aiolos123.gitee.io/blog/2020/01/31/second-kill-system-step-by-step-9/index.html">
<meta property="og:site_name" content="Aiolos">
<meta property="og:description" content="本文为慕课网 《聚焦Java性能优化 打造亿级流量秒杀系统》视频教程的学习笔记实战视频地址： https://coding.imooc.com/class/chapter/338.html前期免费视频地址： http://www.imooc.com/learn/1079代码地址：https://gitee.com/aiolos123/secondkill 本文为第三章jmeter性能压测的内容">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201121837201.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201122219271.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201122402000.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201122822515.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201122620823.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201123332762.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201125228585.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201125448713.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201125643926.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200201130028363.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200202140350687.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200202140710656.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200202142923666.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200202143424971.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200202153525907.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200202164201269.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200202164508763.jpg">
<meta property="og:image" content="https://aiolos123.gitee.io/blog/images/20200202165941353.jpg">
<meta property="og:updated_time" content="2020-02-02T14:56:01.832Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="【九】聚焦Java性能优化 打造亿级流量秒杀系统——性能压测">
<meta name="twitter:description" content="本文为慕课网 《聚焦Java性能优化 打造亿级流量秒杀系统》视频教程的学习笔记实战视频地址： https://coding.imooc.com/class/chapter/338.html前期免费视频地址： http://www.imooc.com/learn/1079代码地址：https://gitee.com/aiolos123/secondkill 本文为第三章jmeter性能压测的内容">
<meta name="twitter:image" content="https://aiolos123.gitee.io/blog/images/20200201121837201.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://aiolos123.gitee.io/blog/2020/01/31/second-kill-system-step-by-step-9/">





  <title>【九】聚焦Java性能优化 打造亿级流量秒杀系统——性能压测 | Aiolos</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Aiolos</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">记录我的成长点滴</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/blog/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/blog/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://aiolos123.gitee.io/blog/blog/2020/01/31/second-kill-system-step-by-step-9/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="aiolos">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Aiolos">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">【九】聚焦Java性能优化 打造亿级流量秒杀系统——性能压测</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-01-31T05:59:13+08:00">
                2020-01-31
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/SpringBoot/" itemprop="url" rel="index">
                    <span itemprop="name">SpringBoot</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>本文为慕课网 《聚焦Java性能优化 打造亿级流量秒杀系统》视频教程的学习笔记<br>实战视频地址： <a href="https://coding.imooc.com/class/chapter/338.html" target="_blank" rel="noopener">https://coding.imooc.com/class/chapter/338.html</a><br>前期免费视频地址： <a href="http://www.imooc.com/learn/1079" target="_blank" rel="noopener">http://www.imooc.com/learn/1079</a><br>代码地址：<a href="https://gitee.com/aiolos123/secondkill" target="_blank" rel="noopener">https://gitee.com/aiolos123/secondkill</a></p>
<p>本文为第三章jmeter性能压测的内容</p>
<a id="more"></a>

<h2 id="容量问题优化之处"><a href="#容量问题优化之处" class="headerlink" title="容量问题优化之处"></a>容量问题优化之处</h2><ol>
<li>Server端并发线程数上不去</li>
<li>响应时间变长，TPS上不去</li>
</ol>
<h2 id="容量问题优化的经验结论"><a href="#容量问题优化的经验结论" class="headerlink" title="容量问题优化的经验结论"></a>容量问题优化的经验结论</h2><ol>
<li><p>单台Web容器上限的经验结论</p>
<blockquote>
<p>线程数量：4核cpu8G内存单进程调度线程数800-1000。在1000以上就会花费巨大的时间在cpu调度上————即高并发多线程TPS存在拐点(<strong>4核cpu8G内存的单个Tomcat的最佳线程池是800个线程</strong>)。<br>等待队列长度： 队列做缓冲池用，但也不能无限长，消耗内存。出队入队也耗cpu。一般设置为1000-2000</p>
</blockquote>
</li>
<li><p>MySQL数据库QPS容量问题经验结论</p>
<blockquote>
<p>主键查询： 千万级别数据 =&gt; 1-10毫秒<br>唯一索引查询： 千万级别数据 =&gt; 10-100毫秒<br>非唯一索引查询： 千万级别数据 =&gt; 100-1000毫秒<br>无索引查询(会全表扫描)： 百万条数据 =&gt; 1000毫秒 +</p>
</blockquote>
</li>
</ol>
<p><strong>设计数据库时，查询尽量是在主键查询和唯一索引查询上，最差查询也是非唯一索引查询，尽量不要进行无索引查询(会全表扫描)</strong></p>
<p><strong>a. 不走索引的查询就是全表扫描，这在大型系统中是不可接受的！</strong><br><strong>b. 千万级数据的非唯一索引查询就要考虑分库分表，扩容热点数据的问题</strong></p>
<ol start="3">
<li><p>MySQL数据库TPS容量问题经验结论</p>
<blockquote>
<p>非插入的更新删除操作： 同查询<br>插入操作： 1w ~ 10w tps(依赖配置优化，后续讲解)</p>
</blockquote>
</li>
<li><p>企业级项目中，单台机器上的TPS在200左右是不能接受的！</p>
</li>
</ol>
<h2 id="jmeter的安装"><a href="#jmeter的安装" class="headerlink" title="jmeter的安装"></a>jmeter的安装</h2><blockquote>
<p>为什么需要性能压测：测试高并发下系统的表现，发现系统瓶颈</p>
</blockquote>
<ol>
<li><p>下载jmeter的zip包</p>
<blockquote>
<p>可参考《Jmeter工具安装与启动》：<a href="https://blog.csdn.net/weixin_36886116/article/details/83023020" target="_blank" rel="noopener">https://blog.csdn.net/weixin_36886116/article/details/83023020</a><br>官网：<a href="https://jmeter.apache.org/" target="_blank" rel="noopener">https://jmeter.apache.org/</a></p>
</blockquote>
</li>
<li><p>解压并运行bin\jmeter.bat，启动jmeter<br><img src="/blog/images/20200201121837201.jpg" alt="启动jmeter"></p>
</li>
</ol>
<h2 id="jmeter的使用"><a href="#jmeter的使用" class="headerlink" title="jmeter的使用"></a>jmeter的使用</h2><blockquote>
<p>jmeter相关概念: 线程组(用于启动多个并发请求，用于测试服务器的压力)、Http请求、查看结果树、聚合报告</p>
</blockquote>
<ol>
<li><p>首先添加线程组<br><img src="/blog/images/20200201122219271.jpg" alt="添加线程组"></p>
</li>
<li><p>在线程组下创建Http请求<br><img src="/blog/images/20200201122402000.jpg" alt="创建Http请求"></p>
</li>
<li><p>在线程组下创建查看结果树<br><img src="/blog/images/20200201122822515.jpg" alt="创建查看结果树"></p>
</li>
<li><p>在线程组下创建聚合报告<br><img src="/blog/images/20200201122620823.jpg" alt="创建聚合报告"></p>
</li>
<li><p>在Http请求中配置压测的url</p>
<blockquote>
<p>注意：客户端实现需要选择Java，因为这个版本的Jmeter只有选择Java这个客户端实现，KeepAlive才能实现。因为压力测试真正想测试的是接口的响应时间性能，而如果大部分性能消耗在建立连接、关闭连接上，这样的压测是没有意义的，所以不使用短连接，而是通过KeepAlive建立长连接。</p>
</blockquote>
</li>
</ol>
<p><img src="/blog/images/20200201123332762.jpg" alt="创建Http请求"></p>
<ol start="6">
<li><p>先调小线程组，启动压力测试，防止线程多了影响应用的正常使用<br><img src="/blog/images/20200201125228585.jpg" alt="启动压力测试"></p>
</li>
<li><p>查看压测结果<br><img src="/blog/images/20200201125448713.jpg" alt="查看压测结果"></p>
</li>
<li><p>调大线程组到20，清空压测结果，再次压力测试<br><img src="/blog/images/20200201125643926.jpg" alt="再次压力测试"></p>
</li>
<li><p>聚合报告数据分析<br><img src="/blog/images/20200201130028363.jpg" alt="压测结果说明"></p>
</li>
</ol>
<p>在聚合报告中(时间单位：ms)：</p>
<blockquote>
<p>Average: 表示平均响应时间；<br>Median: 表示中位数响应时间；<br>90%Line: 表示90%的请求在14ms之内返回<br>95%Line: 表示95%的请求在18ms之内返回 (重点关注指标)<br>Min: 表示最小响应时间为14ms；<br>Maximum: 表示最大响应时间为23ms<br>Throughput: 表示TPS为2.1  (重点关注指标)</p>
</blockquote>
<h2 id="发现容量问题的第一步：-检查系统的承载并发数是否很高，即server端并发线程数的上限是多少"><a href="#发现容量问题的第一步：-检查系统的承载并发数是否很高，即server端并发线程数的上限是多少" class="headerlink" title="发现容量问题的第一步： 检查系统的承载并发数是否很高，即server端并发线程数的上限是多少"></a>发现容量问题的第一步： 检查系统的承载并发数是否很高，即server端并发线程数的上限是多少</h2><blockquote>
<p>什么系统是高性能系统：能够承载越来越多的高并发(即TPS高)——并发数支持的越高，越来越快速的响应返回</p>
</blockquote>
<blockquote>
<p>TPS = 并发数/每个并发的耗时</p>
</blockquote>
<ol>
<li>查看系统某进程下对应的线程数<figure class="highlight vala"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#查看服务器运行的应用的进程号</span></span><br><span class="line"><span class="meta"># ps -ef | grep java</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#查看该进程下对应的线程数(假设通过上述命令查到的进程号为3046)</span></span><br><span class="line"><span class="meta"># pstree -p 3046 | wc -l</span></span><br></pre></td></tr></table></figure>

</li>
</ol>
<blockquote>
<p>重要指标一： <strong>上述命令得到的”线程数-1”就是Tomcat在无压力的情况下默认维护的线程池的线程数量(本例即为27个)。</strong></p>
</blockquote>
<p>查看系统进程下对应的线程数如下图：<br><img src="/blog/images/20200202140350687.jpg" alt="查看系统进程下对应的线程数"></p>
<ol start="2">
<li>通过top H命令查看服务器性能<figure class="highlight vala"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta"># 在top H命令中需要关注的指标： </span></span><br><span class="line"><span class="meta"># %Cpu(s) 中的us： 表示在用户态下执行用户程序的CPU占有率</span></span><br><span class="line"><span class="meta"># %Cpu(s) 中的sy： 表示在内核态下执行系统程序的CPU占有率</span></span><br><span class="line"><span class="meta"># 上述两个占有率之和不能超过100%</span></span><br><span class="line"><span class="meta"># load average: 表示最近1分钟、5分钟、15分钟CPU的load的数量</span></span><br><span class="line"><span class="meta"># CPU的load：表示CPU的运算情况，越低越好，越高表示CPU运算很忙。 2核CPU控制在2以内即可，超过2表示CPU处于非常忙碌状态。(这个指标需要重点关注)</span></span><br></pre></td></tr></table></figure>

</li>
</ol>
<blockquote>
<p>重要指标二： <strong>CPU的load值是需要重点关注的，如果load的值越高表示CPU运算很忙。如果CPU load和%Cpu(s)都很高，说明程序真的有问题！</strong><br>重要指标三： <strong>PID列表中%CPU：表示该进程的CPU占用率！</strong></p>
</blockquote>
<p>通过top H命令查看服务器性能如下图：<br><img src="/blog/images/20200202140710656.jpg" alt="通过top H命令查看服务器性能"></p>
<ol start="2">
<li><p>逐步增加线程组中的线程数，通过top H查看指标<br><img src="/blog/images/20200202142923666.jpg" alt="通过top H命令查看服务器性能"></p>
</li>
<li><p>增加线程组在的线程到5000或更高，循环100次(直至出现请求错误)，这时再查看线程数，就可以发现这个进程能服务的最大线程数(本例中为217个)<br><img src="/blog/images/20200202143424971.jpg" alt="出现请求错误"></p>
</li>
<li><p>这时就可以发现server端并发上不去的最大原因：就是<strong>这个进程能服务的最大线程数有上限(本例中为217个)</strong>，即server端并发线程数的上限是217，导致server端的并发线程开不出来(即TPS上不去)，从而使服务直接被拒绝连接</p>
</li>
<li><p>容量问题原因的小结</p>
<blockquote>
<p>因为server端支持的并发线程有上限，导致server端并发线程上不去，进而导致整个TPS容量上不去，最终导致客户端被拒绝连接后出现各种错误</p>
</blockquote>
</li>
</ol>
<h2 id="发现容量问题的第二步：-为什么tomcat中的并发线程上不去"><a href="#发现容量问题的第二步：-为什么tomcat中的并发线程上不去" class="headerlink" title="发现容量问题的第二步： 为什么tomcat中的并发线程上不去"></a>发现容量问题的第二步： 为什么tomcat中的并发线程上不去</h2><ol>
<li>在SpringBoot项目的spring-configuration-metadata.json文件下，查看内置Tomcat的默认配置</li>
</ol>
<p>以server.tomcat开头的都是springboot内置tomcat的配置，其中：</p>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">a</span>. server<span class="selector-class">.tomcat</span><span class="selector-class">.accept-count</span>: 表示当tomcat的工作线程被全部占满后，最大的等待队列长度，默认为<span class="number">100</span>。 即当tomcat的线程池被占满后，再超过<span class="number">100</span>个队列的大小后，对应的请求将被拒绝(其原理同线程池)</span><br><span class="line"><span class="selector-tag">b</span>. server<span class="selector-class">.tomcat</span><span class="selector-class">.min-spare-threads</span>: tomcat支持的最小工作线程数，即tomcat默认启动的最小线程数，默认为<span class="number">10</span>。</span><br><span class="line">c. server<span class="selector-class">.tomcat</span><span class="selector-class">.max-connections</span>:  tomcat默认接受的最大连接数。 默认为<span class="number">10000</span>。</span><br><span class="line">d. server<span class="selector-class">.tomcat</span><span class="selector-class">.max-threads</span>: tomcat支持的最大工作线程数。默认为<span class="number">200</span></span><br></pre></td></tr></table></figure>

<p><strong>默认配置下，连接超过10000后出现拒绝连接情况</strong><br><strong>默认配置下，触发的并发请求超过200+100后拒绝处理</strong></p>
<p>总结Springboot内置Tomcat的默认配置如下：<br><img src="/blog/images/20200202153525907.jpg" alt="内置Tomcat的默认配置"></p>
<ol start="2">
<li>调整内置tomcat配置<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">server:</span></span><br><span class="line"><span class="attr">   tomcat:</span></span><br><span class="line"><span class="attr">      max-connections:</span> <span class="number">10000</span> <span class="comment"># 单机10000连接数是合适的</span></span><br><span class="line"><span class="attr">      accept-count:</span> <span class="number">1000</span> <span class="comment">#等待队列</span></span><br><span class="line"><span class="attr">      max-threads:</span> <span class="number">800</span> <span class="comment"># 4核8G的机器最优经验值是800； 本人为1核1G的虚拟机</span></span><br><span class="line"><span class="attr">      min-spare-threads:</span> <span class="number">100</span></span><br></pre></td></tr></table></figure>

</li>
</ol>
<p>调整内置tomcat配置如下：<br><img src="/blog/images/20200202164201269.jpg" alt="调整内置tomcat配置"></p>
<p>调整内置tomcat配置后启动项目，查看默认支持的进程数(本例中为118，调整之前为27，大约增长4倍)：<br><img src="/blog/images/20200202164508763.jpg" alt="调整内置tomcat配置"></p>
<ol start="3">
<li>通过jmeter压测(jmeter在单台机器上的可跑的最大线程为1000左右)<br><img src="/blog/images/20200202165941353.jpg" alt="通过jmeter压测"></li>
</ol>
<p>通过调整内置Tomcat的配置，在没有修改代码的情况下，server端并发线程数的上限已经从217增大到417</p>
<h2 id="发现容量问题的第三步：-定制化内嵌tomcat开发"><a href="#发现容量问题的第三步：-定制化内嵌tomcat开发" class="headerlink" title="发现容量问题的第三步： 定制化内嵌tomcat开发"></a>发现容量问题的第三步： 定制化内嵌tomcat开发</h2><blockquote>
<p>keepalive的作用： 当服务端向客户端发送响应后，服务端不会马上断开连接，而是等待复用连接。<br>它解决了Http的每次请求都要创建连接，返回响应后即可断开连接的问题，保持了客户端和服务端的连接状态，提高通信性能。</p>
</blockquote>
<ol>
<li><p>定制化内嵌tomcat开发需要关注如下两个指标：</p>
<blockquote>
<p>a. keepAliveTimeOut： 多少毫秒后若客户端不响应就断开keepalive<br>b. maxKeepAliveRequests： 一条keepalive在多少次请求后keepalive断开失效</p>
</blockquote>
</li>
<li><p>定制化内嵌tomcat开发的步骤：</p>
<blockquote>
<p>使用WebServerFatoryCustomizer<configurableservletwebserverfactory>接口来定制化内嵌tomcat配置</configurableservletwebserverfactory></p>
</blockquote>
</li>
</ol>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"><span class="markdown">/**</span></span></span><br><span class="line"><span class="comment"><span class="markdown"><span class="bullet"> * </span>定制化内嵌tomcat开发：</span></span></span><br><span class="line"><span class="comment"><span class="markdown"><span class="bullet"> * </span>当Spring容器内没有TomcatEmbeddedServletContainerFactory这个bean时，</span></span></span><br><span class="line"><span class="comment"><span class="markdown"><span class="bullet"> * </span>会把此bean加载进spring容器中</span></span></span><br><span class="line"><span class="comment"><span class="markdown"> */</span></span></span><br><span class="line"><span class="meta">@Component</span></span><br><span class="line">public <span class="class"><span class="keyword">class</span> <span class="title">WebServerConfiguration</span> <span class="keyword">implements</span> <span class="title">WebServerFactoryCustomizer</span>&lt;<span class="title">ConfigurableWebServerFactory</span>&gt; </span>&#123;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    public <span class="keyword">void</span> customize(ConfigurableWebServerFactory <span class="keyword">factory</span>) &#123;</span><br><span class="line">        <span class="comment">//使用对应工厂类提供给我们的接口定制化我们的tomcat connector</span></span><br><span class="line">        ((TomcatServletWebServerFactory)<span class="keyword">factory</span>).addConnectorCustomizers(<span class="keyword">new</span> TomcatConnectorCustomizer() &#123;</span><br><span class="line">            <span class="meta">@Override</span></span><br><span class="line">            public <span class="keyword">void</span> customize(Connector connector) &#123;</span><br><span class="line">                Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();</span><br><span class="line"></span><br><span class="line">                <span class="comment">//定制化keepalivetimeout, 设置30秒内没有请求则服务端自动断开keepalive连接</span></span><br><span class="line">                protocol.setKeepAliveTimeout(<span class="number">30000</span>);</span><br><span class="line">                <span class="comment">//当客户端发送超过10000个请求，则自动断开keepalive连接</span></span><br><span class="line">                protocol.setMaxKeepAliveRequests(<span class="number">10000</span>);</span><br><span class="line">                <span class="comment">//此处还可以调整springboot内置tomcat的其他配置，如accept-count等</span></span><br><span class="line">            &#125;</span><br><span class="line">        &#125;);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="发现容量问题的优化方向"><a href="#发现容量问题的优化方向" class="headerlink" title="发现容量问题的优化方向"></a>发现容量问题的优化方向</h2><p>上述已经对Tomcat的线程做了扩容，对应的线程池做了变更，keepalivetimeout做了优化。但容量问题还是存在的。</p>
<p>我们发现，随着Jmeter并发线程数的增长，服务器的http请求响应时间变长，TPS在到达200左右就上不去了。</p>
<p>根据本文第一节的经验结论，TPS上不去还可以优化数据库查询。</p>
<h2 id="附：-查看CentOS的系统参数"><a href="#附：-查看CentOS的系统参数" class="headerlink" title="附： 查看CentOS的系统参数"></a>附： 查看CentOS的系统参数</h2><p>见：<a href="https://www.cnblogs.com/fqxy/p/10196160.html" target="_blank" rel="noopener">https://www.cnblogs.com/fqxy/p/10196160.html</a></p>
<blockquote>
<p>总核数 = 物理CPU个数 X 每颗物理CPU的核数<br>总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数</p>
</blockquote>
<ol>
<li><p>查看物理CPU个数<br>cat /proc/cpuinfo| grep “physical id”| sort| uniq| wc -l</p>
</li>
<li><p>查看每个物理CPU中core的个数(即核数)<br>cat /proc/cpuinfo| grep “cpu cores”| uniq</p>
</li>
<li><p>查看逻辑CPU的个数<br>cat /proc/cpuinfo| grep “processor”| wc -l</p>
</li>
</ol>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/blog/tags/聚焦Java性能优化-打造亿级流量秒杀系统/" rel="tag"># 聚焦Java性能优化 打造亿级流量秒杀系统</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/2020/01/30/second-kill-system-step-by-step-8/" rel="next" title="【八】聚焦Java性能优化 打造亿级流量秒杀系统——实战课程简介">
                <i class="fa fa-chevron-left"></i> 【八】聚焦Java性能优化 打造亿级流量秒杀系统——实战课程简介
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/2020/02/02/second-kill-system-step-by-step-10/" rel="prev" title="【十】聚焦Java性能优化 打造亿级流量秒杀系统——分布式扩展">
                【十】聚焦Java性能优化 打造亿级流量秒杀系统——分布式扩展 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">aiolos</p>
              <p class="site-description motion-element" itemprop="description">Java Spring Hadoop 机器学习</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">126</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/blog/categories/index.html">
                  <span class="site-state-item-count">16</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/blog/tags/index.html">
                  <span class="site-state-item-count">33</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#容量问题优化之处"><span class="nav-number">1.</span> <span class="nav-text">容量问题优化之处</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#容量问题优化的经验结论"><span class="nav-number">2.</span> <span class="nav-text">容量问题优化的经验结论</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jmeter的安装"><span class="nav-number">3.</span> <span class="nav-text">jmeter的安装</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jmeter的使用"><span class="nav-number">4.</span> <span class="nav-text">jmeter的使用</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#发现容量问题的第一步：-检查系统的承载并发数是否很高，即server端并发线程数的上限是多少"><span class="nav-number">5.</span> <span class="nav-text">发现容量问题的第一步： 检查系统的承载并发数是否很高，即server端并发线程数的上限是多少</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#发现容量问题的第二步：-为什么tomcat中的并发线程上不去"><span class="nav-number">6.</span> <span class="nav-text">发现容量问题的第二步： 为什么tomcat中的并发线程上不去</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#发现容量问题的第三步：-定制化内嵌tomcat开发"><span class="nav-number">7.</span> <span class="nav-text">发现容量问题的第三步： 定制化内嵌tomcat开发</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#发现容量问题的优化方向"><span class="nav-number">8.</span> <span class="nav-text">发现容量问题的优化方向</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#附：-查看CentOS的系统参数"><span class="nav-number">9.</span> <span class="nav-text">附： 查看CentOS的系统参数</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">aiolos</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/blog/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/blog/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  

  

  

</body>
</html>
